package foodmaterial.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import foodmaterial.action.valid.ObjectNullValid;
import foodmaterial.utils.Constants;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

public class OrdersDetail implements Serializable {
    private static final long serialVersionUID = -9008232498695994527L;

    private Long id;
    private Long ordersId; //'订单id',
    @ObjectNullValid(message = "食材不能为空")
    private Long foodMaterialId; //'食材',
    private String foodMaterialName ;
    private String specs ;
    private String brand ;
    private String unitName ;
    private Double raxRate ;
    private BigDecimal buyPrice;// '进货价格',
    @ObjectNullValid(message = "进货价不能为空")
    @DecimalMin(value = "0.01",message = "销售价格最低为0.01")
    private BigDecimal salePrice; //'销售价格',
    private Integer amount ;//单人数量
    private Integer expressionUnit ;//计算单位，普通排餐计算总消耗的时候使用
    @ObjectNullValid(message = "食材总量不能为空")
    @Min(value = 1,message = "食材总量最低为1")
    @Max(value=100000,message = "食材总量最大为100000")
    private Integer totalAmount;// '食材总数量'
    private BigDecimal total ; //金额
    private Double energy ;
    private Double protein;
    private Double fat;
    private Double carbohydrate;
    //批量改价格使用，其他时候不使用
    private Date eatDate ;
    private String orderType ;
    private Long mealsTypeId ;//查询的时候使用
    private String mealsTypeName ;//查询的时候使用
    private Date supplyDate ;
    @JsonFormat(pattern= Constants.DEFAULT_DATE_FORMAT,timezone="GMT+8")
    private Date distributionDate ;
    private Long customerId ;
    private String customerName ;
    private Integer showOrder; //按照线路统计配货单的客户显示顺序
    private Long routerId ;//线路，打印标签的时候使用
    private String routerName ;
    private String supplierName ;//供应商
    private String label ;//打印标签的时候使用
    private Boolean originalProcess ;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getOrdersId() {
        return ordersId;
    }

    public void setOrdersId(Long ordersId) {
        this.ordersId = ordersId;
    }

    public Long getFoodMaterialId() {
        return foodMaterialId;
    }

    public void setFoodMaterialId(Long foodMaterialId) {
        this.foodMaterialId = foodMaterialId;
    }

    public String getFoodMaterialName() {
        return foodMaterialName;
    }

    public void setFoodMaterialName(String foodMaterialName) {
        this.foodMaterialName = foodMaterialName;
    }

    public String getSpecs() {
        return specs;
    }

    public void setSpecs(String specs) {
        this.specs = specs;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getUnitName() {
        return unitName;
    }

    public void setUnitName(String unitName) {
        this.unitName = unitName;
    }

    public Double getRaxRate() {
        return raxRate;
    }

    public void setRaxRate(Double raxRate) {
        this.raxRate = raxRate;
    }

    public BigDecimal getBuyPrice() {
        return buyPrice;
    }

    public void setBuyPrice(BigDecimal buyPrice) {
        this.buyPrice = buyPrice;
    }

    public BigDecimal getSalePrice() {
        return salePrice;
    }

    public void setSalePrice(BigDecimal salePrice) {
        this.salePrice = salePrice;
    }

    public Integer getAmount() {
        return amount;
    }

    public void setAmount(Integer amount) {
        this.amount = amount;
    }

    public Integer getExpressionUnit() {
        return expressionUnit;
    }

    public void setExpressionUnit(Integer expressionUnit) {
        this.expressionUnit = expressionUnit;
    }

    public Integer getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(Integer totalAmount) {
        this.totalAmount = totalAmount;
    }

    public BigDecimal getTotal() {
        return total;
    }

    public void setTotal(BigDecimal total) {
        this.total = total;
    }

    public Double getEnergy() {
        return energy;
    }

    public void setEnergy(Double energy) {
        this.energy = energy;
    }

    public Double getProtein() {
        return protein;
    }

    public void setProtein(Double protein) {
        this.protein = protein;
    }

    public Double getFat() {
        return fat;
    }

    public void setFat(Double fat) {
        this.fat = fat;
    }

    public Double getCarbohydrate() {
        return carbohydrate;
    }

    public void setCarbohydrate(Double carbohydrate) {
        this.carbohydrate = carbohydrate;
    }

    public Date getEatDate() {
        return eatDate;
    }

    public void setEatDate(Date eatDate) {
        this.eatDate = eatDate;
    }

    public String getOrderType() {
        return orderType;
    }

    public void setOrderType(String orderType) {
        this.orderType = orderType;
    }

    public Long getMealsTypeId() {
        return mealsTypeId;
    }

    public void setMealsTypeId(Long mealsTypeId) {
        this.mealsTypeId = mealsTypeId;
    }

    public String getMealsTypeName() {
        return mealsTypeName;
    }

    public void setMealsTypeName(String mealsTypeName) {
        this.mealsTypeName = mealsTypeName;
    }

    public Date getSupplyDate() {
        return supplyDate;
    }

    public void setSupplyDate(Date supplyDate) {
        this.supplyDate = supplyDate;
    }

    public Date getDistributionDate() {
        return distributionDate;
    }

    public void setDistributionDate(Date distributionDate) {
        this.distributionDate = distributionDate;
    }

    public Long getCustomerId() {
        return customerId;
    }

    public void setCustomerId(Long customerId) {
        this.customerId = customerId;
    }

    public String getCustomerName() {
        return customerName;
    }

    public void setCustomerName(String customerName) {
        this.customerName = customerName;
    }

    public Integer getShowOrder() {
        return showOrder;
    }

    public void setShowOrder(Integer showOrder) {
        this.showOrder = showOrder;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public String getSupplierName() {
        return supplierName;
    }

    public void setSupplierName(String supplierName) {
        this.supplierName = supplierName;
    }

    public Long getRouterId() {
        return routerId;
    }

    public void setRouterId(Long routerId) {
        this.routerId = routerId;
    }

    public String getRouterName() {
        return routerName;
    }

    public void setRouterName(String routerName) {
        this.routerName = routerName;
    }

    public Boolean getOriginalProcess() {
        return originalProcess;
    }

    public void setOriginalProcess(Boolean originalProcess) {
        this.originalProcess = originalProcess;
    }
}
